//
//  MPGLAboutViewController.m
//  mingpianguanli
//
//  Created by ryou on 2021/6/23.
//
#define ktitleArray @[@"版本号",@"隐私政策",@"分享好友",@"意见反馈"]
#import "MPGLAboutViewController.h"

@interface MPGLAboutViewController ()<UITableViewDelegate,UITableViewDataSource>
@property (weak, nonatomic) IBOutlet UITableView *mpglTableView;

@end

@implementation MPGLAboutViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.mpglTableView.delegate=self;
    self.mpglTableView.dataSource=self;
    self.mpglTableView.tableFooterView=[[UIView alloc]init];
    // Do any additional setup after loading the view from its nib.
    
    [self mingpianguanliloadBannerWithSlotID];

}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

- (nonnull UITableViewCell *)tableView:(nonnull UITableView *)tableView cellForRowAtIndexPath:(nonnull NSIndexPath *)indexPath {
    UITableViewCell *mpglcell=[tableView cellForRowAtIndexPath:indexPath];
    if (!mpglcell) {
        mpglcell=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"dddd"];
    }
    mpglcell.textLabel.text = ktitleArray[indexPath.row];
    mpglcell.selectionStyle=UITableViewCellSelectionStyleNone;
    if (indexPath.row == 0) {
        mpglcell.detailTextLabel.text = @"v 1.0";
    }
    else{
        mpglcell.accessoryType=UITableViewCellAccessoryDisclosureIndicator;
    }
    return mpglcell;
}
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return 80;
}
- (NSInteger)tableView:(nonnull UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return ktitleArray.count;
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    if (indexPath.row>0) {
        [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"https://apps.apple.com/cn/app/id1574310231"] options:@{} completionHandler:nil];
    }
}

@end
